{% extends 'layout.html' %}
{% load web %}
{% block content %}
    <div class="luffy-container">
        <div>
            <a class="btn btn-primary" href="{% memory_url request 'project_add' %}">添加</a>
        </div>
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>项目名称</th>
                <th>仓库地址</th>
                <th>上线</th>
                <th>回滚</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for row in depart_queryset %}
                <tr>
                    <td>{{ row.title }}</td>
                    <td>{{ row.git }}</td>
                    <td>
                        <a class="btn btn-success" target="_blank" href="{% url 'deploy_list' project_id=row.id %}">上线</a>

                    </td>
                    <td>
                        <a class="btn btn-info" target="_blank" href="{% url 'deploy_rollback' project_id=row.id %}">回滚</a>
                    </td>
                    <td>
                        <a class="btn btn-info" href="{% memory_url request 'project_edit' row.id %}">编辑</a>
                        <a class="btn btn-danger" href="{% memory_url request 'project_del' row.id %}">删除</a>
                    </td>

                </tr>
            {% endfor %}
            </tbody>
        </table>
        <nav aria-label="Page navigation">
            <ul class="pagination">
                {{ pager.page_html|safe }}
            </ul>
        </nav>

    </div>
{% endblock %}